package cate.game.play.skill.passive.god;

import cate.common.util.XT;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 觉醒攻击提升20%，当被降低觉醒值时有概率30%直接进入觉醒状态1回合
 */
public class 罪仙PH extends PassiveHandler {

	private int 概率;

	private int 回合;

	//概率=3000&回合=1
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		概率 = args.getInt("概率", 0);
		回合 = args.getInt("回合", 0);
	}

	@Override
	public void onEnergyChange(ActionCtx action, boolean auto, double value) {
		if (auto || value > 0 || skill.owner.status.isAwaken()) {
			return;
		}
		if (!XT.chance(概率)) {
			return;
		}
		skill.owner.skill.doAwaken(action, 回合);
	}
}
